<?php

/**
 * Question filter form.
 *
 * @package    elearning
 * @subpackage filter
 * @author     Your name here
 */
class QuestionFormFilter extends BaseQuestionFormFilter
{
  public function configure()
  {
  //question_status
	  $this->widgetSchema['question_status'] = new sfWidgetFormChoice(array(
					'choices' => TestPeer::getTestStatusChoices(),
					'expanded' => true,
				));
		
		$this->validatorSchema['question_status'] = new sfValidatorChoice(array(
						'required'      => false,
						'choices'       => array_keys(TestPeer::getTestStatusChoices()),
				));
		//$this->setdefault[]
		//$this->setDefaults( array('test_status' => null ) );
		$this->widgetSchema->setNameFormat('question_filters[%s]');	
  }
 
  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'level_id'           => 'ForeignKey',
      'teacher_id'         => 'ForeignKey',
      'question_type_id'   => 'ForeignKey',
      'question_subject'   => 'Text',
      'question_content'   => 'Text',
      'mark'               => 'Number',
      'question_status'    => 'ForeignKey',
      'created_at'         => 'Date',
      'updated_at'         => 'Date',
      'question_test_list' => 'ManyKey',
    );
  }
}
